 
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>Controle de Inscrição</title>
          <link rel="stylesheet" href="css/bootstrap.css">
    </head>
    <body>
        <?php

function verificador($valor)
{
    if($valor =="aprovado"){

           return "success";
    }else if($valor =="pedente"){
          
           return "warning";

    }else{

       return "danger";
    }
    
}
  // imprime '16'.

   
     session_start();
         if(!isset($_SESSION["id"]) AND !isset($_SESSION["nome"])){
             
             header("location:../index.php");
             
         }

            require_once '../conecta.php';

            $sql = "SELECT * FROM participantes WHERE 1";
            $res = mysql_query($sql);            
           
       if($_SESSION["auti"] == 0){
        ?>
            <div class="jumbotron">
              <div class="container">
              <h1>Controle de Inscrição</h1>              
            </div>
            </div>
                
                <div class="panel panel-default">
  <div class="panel-heading">
     <div class="bs-example">
      
    <table class="table">
      <thead>
        <tr>
          <th>#</th>
          <th>Equipe</th>
          <th>Email</th>
          <th>1 Capitao</th>
          <th>2 part</th>
          <th>3 part</th>
          <th>4 part</th>
          <th>5 part</th>
          <th>Situacão</th>
          <th>Confirmar</th>
          <th>Cancelar</th>
          <th>Deletar</th>
          
        </tr>
      </thead>
      <tbody>
        <?php while($registro = mysql_fetch_row($res)) {?>

        <tr class="<?php echo verificador($registro[9]);?>">

          <td><?php echo $registro[0];?></td> <!-- id -->
          <td><?php echo $registro[3]; ?></td> <!-- equipe -->
          <td> <?php echo $registro[1]; ?></td> <!-- email -->
          <td> <?php echo $registro[4]; ?></td>
          <td><?php echo $registro[5]; ?></td>
          <td><?php echo $registro[6]; ?></td>
          <td><?php echo $registro[7]; ?></td>
          <td><?php echo $registro[8]; ?></td>
          <td><?php echo $registro[9]; ?></td>
          <td>                           
               <form class="form-inline" action="updateSituacao.php?id=<?php echo $registro[0]?>" method="post">    
                      <button type="submit" class="btn btn-primary">Confirmar</button>                                                       
               </form>

          </td>
          <td>                           
                <form class="form-inline" action="cancelar.php?id=<?php echo $registro[0]?>" method="post">         
                      <button type="submit" class="btn btn-danger">Cancelar</button>
                </form>
         </td>
           <td>                           
                <form class="form-inline" action="deletar.php?id=<?php echo $registro[0]?>" method="post">         
                      <button type="submit" class="btn btn-warning">Deletar</button>
                </form>
         </td>
        </tr>
        <?php } ?>
        <tr>
       
        </tr>
      </tbody>
    </table>
  </div><!-- /example -->
  </div>
  <div class="panel-body">

    <!-- ... aqui vai o <dl> que já temos hoje ... -->
 

  </div>
</div>
        </div>


  <div class="panel-body">
   
    <!-- ... aqui vai o <dl> que já temos hoje ... -->
   <ul class="nav nav-pills">
       &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp  <strong style="font-size: 30px;">Usuario</strong> :  <a style="font-size:28px;"><?php echo $_SESSION["nome"]?> </a>
     <li class="active"><a href="../logout.php">Sair</a></li>  
  
</ul>

  </div>
    <?php }else{

            header("location:notfound.php");

    }?> 
     
    </body>
</html>
